﻿<%@ Page Title="Справочник контрагентов" Language="C#" MasterPageFile="~/Root.master" AutoEventWireup="true" CodeFile="kontr.aspx.cs" Inherits="Default2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="Server">
    <script src="../Scripts/toolbar.js" type="text/javascript"></script>
    <div class="pageLabel">
        <dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="Справочник контрагентов" Font-Size="Medium" Theme="iOS">
        </dx:ASPxLabel>
    </div>
    
    <div style="float: left; margin-left: 10px;">

        <dx:ASPxMenu ID="mMenu" runat="server" EnableViewState="False" EncodeHtml="False" SeparatorWidth="2px" BackColor="Transparent"
            SeparatorHeight="15px" ItemSpacing="1px">
            <SeparatorBackgroundImage ImageUrl="~\Images\shared\ToolBars\Office2003\SeparatorBackground.png" />
            <ClientSideEvents ItemClick="function(s, e) { MenuItemClick(e, grd_kontr); }" />
            <Items>
                <dx:MenuItem Name="btn_Insert" Text="" ToolTip="Добавить запись" GroupName="grp_edit" BeginGroup="True">
                    <Image Url="~/Images/shared/edit_add.png">
                    </Image>
                </dx:MenuItem>
                <dx:MenuItem GroupName="grp_edit" Name="btn_edit" Text="" ToolTip="Редактировать запись">
                    <Image Url="~/Images/shared/edit.png">
                    </Image>
                </dx:MenuItem>
                <dx:MenuItem GroupName="grp_edit" Name="btn_Delete" Text="" ToolTip="Удалит запись">
                    <Image Url="~/Images/shared/editdelete.png">
                    </Image>
                </dx:MenuItem>
                <dx:MenuItem GroupName="grp_settings" Name="btn_column" Text="" ToolTip="Настройка колонок">
                    <Image Url="~/Images/shared/group.png">
                    </Image>
                </dx:MenuItem>
            </Items>
        </dx:ASPxMenu>
    </div>
    <dx:ASPxMenu ID="menu_exp" runat="server" OnItemClick="menu_exp_ItemClick">
        <Items>
            <dx:MenuItem Name="btn_Excel" Text="" ToolTip="Экспорт в Excel">
                <Image Url="~/Images/shared/EXCEL.png">
                </Image>
            </dx:MenuItem>
        </Items>
    </dx:ASPxMenu>
    <div style="margin-right: 10px; margin-left: 10px">
        <dx:ASPxGridView ID="grd_kontr" runat="server" AutoGenerateColumns="False" ClientInstanceName="grd_kontr"
            DataSourceID="ds_kontr" KeyFieldName="CODE" OnRowInserting="grd_kontr_RowInserting" Width="100%" OnCellEditorInitialize="grd_kontr_CellEditorInitialize">
            <Columns>
                <dx:GridViewDataTextColumn FieldName="CODE" ReadOnly="True" VisibleIndex="1" Caption="Код"
                    FixedStyle="Left" CellStyle-BackColor="#ffffd6" Width="60px" ShowInCustomizationForm="True">
                    <Settings AllowAutoFilter="False" />
                    <EditFormSettings Visible="False" />
                    <CellStyle BackColor="#CCCCCC"></CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="NAME" VisibleIndex="2" Caption="Краткое наименование"
                    FixedStyle="Left" Width="180px" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="FULLNAME" VisibleIndex="3" Caption="Полное наименование" Width="180px" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="INN" VisibleIndex="4" Caption="ИНН" Visible="False" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="KPP" VisibleIndex="5" Caption="КПП" Visible="False" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="URADDR" VisibleIndex="6" Caption="Юридический адрес" Width="180px" Visible="False" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="POSTADDR" VisibleIndex="7" Caption="Почтовый адрес" Width="180px" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="PHONE" VisibleIndex="8" Caption="Телефоны" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="EMAIL" VisibleIndex="9" Caption="@Email" Visible="False" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataComboBoxColumn Caption="Директор" FieldName="DIR" VisibleIndex="9" Width="180px" ShowInCustomizationForm="True">
                    <PropertiesComboBox DataSourceID="ds_worker" TextField="FIO" ValueField="CODE" ValueType="System.Int32" Width="220px">
                    </PropertiesComboBox>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataComboBoxColumn>
                <dx:GridViewDataTextColumn FieldName="BANK" VisibleIndex="10" Caption="Наименование банка" Width="180px" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="BIK" VisibleIndex="11" Caption="БИК банка" Visible="False" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="SCHET" VisibleIndex="13" Caption="Номер счета" Visible="False" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="KSCHET" VisibleIndex="14" Caption="Номер корсчета" Width="140px" Visible="False" ShowInCustomizationForm="True">
                    <PropertiesTextEdit Width="220px">
                    </PropertiesTextEdit>
                    <EditFormSettings Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataCheckColumn Caption="Главная фирма" FieldName="CHIEFFIRM" VisibleIndex="12" Width="140px">
                    <PropertiesCheckEdit ValueChecked="1" ValueType="System.Byte" ValueUnchecked="0">
                    </PropertiesCheckEdit>
                    <Settings AllowAutoFilter="False" />
                </dx:GridViewDataCheckColumn>
            </Columns>
            <SettingsBehavior AllowFocusedRow="True" ConfirmDelete="True" EnableCustomizationWindow="true" ColumnResizeMode="Control" />
            <SettingsPager AlwaysShowPager="True">
            </SettingsPager>
            <Settings ShowFilterRow="True" HorizontalScrollBarMode="Auto" ShowFooter="True" />
        </dx:ASPxGridView>
    </div>
    <asp:EntityDataSource ID="ds_worker" runat="server" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar" EnableFlattening="False" EntitySetName="WORKER" Select="it.[CODE], it.[FIO]" EntityTypeFilter="" Where="" OnSelecting="ds_worker_Selecting">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="ds_kontr" runat="server" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="KONTRAGENT">
    </asp:EntityDataSource>
    <dx:ASPxGridViewExporter ID="grd_export" runat="server" GridViewID="grd_kontr"></dx:ASPxGridViewExporter>
</asp:Content>

